#ifndef _PGTIMER_H_
#define _PGTIMER_H_

#include <Windows.h>
#include"pgLog.h"
#include"Singleton.h"

class PALEGEM_API pgTimer
{
public:

	pgTimer();
	~pgTimer();
	
	 float GetTicks()
	 {
		 return (float)m_fLastFrameTime;
	 }

	 float GetAverageFPS() {return m_fAverageFPS;}
	 void Init();
	 void Update();
private:
	
	long double m_fLastFrameTime;
	float m_fAverageFPS;

	LONGLONG m_pFrequencyCount;			// counts per second
	LONGLONG m_pLastCount;				// Start
	LONGLONG m_pCurCount;				// End
	LONGLONG m_llElapsed;
					
};

#define g_PG_pTimer g_PG_pPaleGemFramework->GetTimer()

#endif